import { defineStore } from "pinia";
export const useAppStore = defineStore("useAppStore", {
    state: () => ({
        state: {
            appIsLogin: false, //是否登录
            appIsReady: false, //app数据是否就绪
            appIsRender: false, //app是否开始渲染内容
            layout : true,
            routes: [], //最终的路由集合
            menus: [], //菜单集合
            routeToMeta: {}, //url对应标题meta信息
            tabs: [], //tab标签页集合
            activeTabName: "", //tab当前焦点页
            closedTabs: [], //存储已经关闭过的tab
            deptUser: {}
        }
    }),
    actions: {
        updateState(newState) {
            Object.keys(newState).forEach((key) => {
                this.state[key] = newState[key];
            });
        },
        addDeptUser(user) {
            this.state.deptUser = user;
        }
    }
});